package br.com.jvet.util.testes;

import java.util.Date;
import java.util.Properties;

import javax.ejb.embeddable.EJBContainer;
import javax.naming.NamingException;

import org.junit.Before;
import org.junit.BeforeClass;
import org.junit.Test;

import br.com.jvet.entidade.Exame;
import br.com.jvet.entidade.Servico;
import br.com.jvet.persistencia.ServicoDAO;

public class ServicoTesteCRUD {
	ServicoDAO servicoDAO;

	private double valor;

	private static EJBContainer container;

	@BeforeClass
	public static void setUpContainer() throws Exception {
		Properties props = new Properties();
		props.put("hibernate.dialect", "org.hibernate.dialect.HSQLDialect");
		props.put("hibernate.hbm2ddl.auto", "update");

		container = EJBContainer.createEJBContainer(props);
	}

	@Before
	public void setUpBeans() throws NamingException {
		servicoDAO = (ServicoDAO) container.getContext().lookup(
				"java:global/jvet/ServicoDAO");
	}

	@Test
	public void testeIncluirServico() {
		Servico servico = new Servico();
		servico.setCodigo(0);
		servico.setDataCadastro(new Date());
		servico.setDescServico(null);
		servico.setValor(valor);
		servico.setAcrescimo(valor);
		
		Exame exame = new Exame();
	    exame.setDescricao(null);
	     
	 		
		
		
	}

}
